package cn.yiueil;

public class SimpleFactory {
    public static Product createProduct(int type) {
        if (type == 1) {
            return new Product1();
        } else if (type == 2) {
            return new Product2();
        } else if (type == 3) {
            return new Product3();
        }
        throw new RuntimeException("不支持的产品类型");
    }
}
